<template>
  <div class="not-found-page">
    <div class="not-found-container">
      <div class="not-found-content">
        <div class="error-code">404</div>
        <h1 class="error-title">页面不存在</h1>
        <p class="error-message">抱歉，您访问的页面不存在或已被移除。</p>
        <div class="error-actions">
          <el-button type="primary" @click="goHome">
            <el-icon><HomeFilled /></el-icon>
            返回首页
          </el-button>
          <el-button @click="goBack">
            <el-icon><ArrowLeft /></el-icon>
            返回上页
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
import { HomeFilled, ArrowLeft } from "@element-plus/icons-vue";

const router = useRouter();

const goHome = () => {
  router.push("/");
};

const goBack = () => {
  router.go(-1);
};
</script>

<style scoped lang="scss">
.not-found-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;

  .not-found-container {
    text-align: center;
    color: white;

    .not-found-content {
      max-width: 500px;

      .error-code {
        font-size: 120px;
        font-weight: bold;
        line-height: 1;
        margin-bottom: 20px;
        text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
      }

      .error-title {
        font-size: 36px;
        font-weight: 600;
        margin-bottom: 15px;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      }

      .error-message {
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 40px;
        opacity: 0.9;
      }

      .error-actions {
        display: flex;
        gap: 20px;
        justify-content: center;

        .el-button {
          padding: 12px 30px;
          font-size: 16px;
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .not-found-page {
    padding: 20px 10px;

    .not-found-container {
      .not-found-content {
        .error-code {
          font-size: 80px;
        }

        .error-title {
          font-size: 28px;
        }

        .error-message {
          font-size: 14px;
        }

        .error-actions {
          flex-direction: column;
          align-items: center;

          .el-button {
            width: 200px;
          }
        }
      }
    }
  }
}
</style>
